-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically closing tags in multi-cursor mode only closes one tag #490
Automatically closing tags in multi-cursor mode only closes one tag #490
Conversation
The PR was easy to do, I have just copied/pasted code from https://github.com/microsoft/vscode/blob/main/extensions/html-language-features/client/src/tagClosing.ts The only thing that I noticed is that the tagComplete coming from language server should return only string instead of string+range. I will create a PR on LemMinx side to fix that, but you can play with the PR now, it should work. |
I decided to test this use case: We could try to support adding the correct close tag by passing an array of cursors in the Then again, it might not be worthwhile to support this use case, since you expect the same text to appear at all the cursors when using multi cursor mode. |
@datho7561 for the moment I would like to have the same behavior than HTML language feature. Your idea seems great, but perhaps we should discuss about that with vscode html language service team to have the same code tagClosing.ts |
@datho7561 nice catch! However I think we can fix it later, as you said, the common use case, from a user standpoint, is to multi-close the same tags. Unrelated: to review the PR while ignoring whitespace changes, append ?w=1 to the files url: https://github.com/redhat-developer/vscode-xml/pull/490/files?w=1 |
The code is just a copy/paste from html language feature of vscode. |
5da7584
to
29a1cf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and works great! Just one small change
29a1cf7
to
19d0a62
Compare
Fixes redhat-developer#225 Signed-off-by: azerr <[email protected]>
Automatically closing tags in multi-cursor mode only closes one tag
Fixes #225
Signed-off-by: azerr [email protected]